<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>文章列表</title>
    {include file="public/header"}
    <link href="__CSS__/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="__JS__/plugins/fancybox/jquery.fancybox.css" rel="stylesheet">
    <link href="__JS__/layui/css/layui.css" rel="stylesheet">
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <!-- Panel Other -->
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>网站信息</h5>
        </div>
        <div class="ibox-content">
            <div class="tabs-container">
                <ul class="nav nav-tabs">
                    <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true"> 网站信息</a></li>
                    <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">SEO设置</a></li>
                    <li class=""><a data-toggle="tab" href="#tab-3" aria-expanded="false">APP版本管理</a></li>
                    <li class=""><a data-toggle="tab" href="#tab-4" aria-expanded="false">店铺开店数</a></li>
                    <li class=""><a data-toggle="tab" href="#tab-5" aria-expanded="false">用户购买单数</a></li>
                    <li class=""><a data-toggle="tab" href="#tab-6" aria-expanded="false">支付密码配置</a></li>
                    <li class=""><a data-toggle="tab" href="#tab-7" aria-expanded="false">交易配置</a></li>
                </ul>
                <div class="tab-content">
                    <div id="tab-1" class="tab-pane active">
                        <div class="panel-body">
                            <!--网站信息-->
                            {include file="setting_public/site_info"}
                        </div>
                    </div>
                    <div id="tab-2" class="tab-pane">
                        <div class="panel-body">
                            <!--SEO-->
                            {include file="setting_public/seo_set"}
                        </div>
                    </div>
                    <div id="tab-3" class="tab-pane">
                        <div class="panel-body">
                            <!--SEO-->
                            {include file="setting_public/app_version"}
                        </div>
                    </div>
                    <div id="tab-4" class="tab-pane">
                        <div class="panel-body">
                            <!--SEO-->
                            {include file="setting_public/store"}
                        </div>
                    </div>
                    <div id="tab-5" class="tab-pane">
                        <div class="panel-body">
                            <!--SEO-->
                            {include file="setting_public/pay_num"}
                        </div>
                    </div>
                    <div id="tab-6" class="tab-pane">
                        <div class="panel-body">
                            <!--SEO-->
                            {include file="setting_public/pay_error_num"}
                        </div>
                    </div>
                    <div id="tab-7" class="tab-pane">
                        <div class="panel-body">
                            <!--SEO-->
                            {include file="setting_public/transaction"}
                        </div>
                    </div>
                </div>


            </div>
        </div>
    </div>
</div>
<!-- End Panel Other -->
{include file="public/footer"}
<script src="__JS__/layui/layui.js"></script>
<script src="__JS__/jquery.form.js"></script>
<script src="__JS__/plugins/bootstrap-tagsinput/bootstrap-tagsinput.min.js"></script>
<script src="__JS__/plugins/validate/jquery.validate.min.js"></script>
<script src="__JS__/plugins/validate/messages_zh.min.js"></script>
<script src="__JS__/plugins/ueditor/ueditor.config.js"></script>
<script src="__JS__/plugins/ueditor/ueditor.all.js"></script>


<script type="text/javascript">

    var index = '';

    function showStart() {
        index = layer.load(0, {shade: false});
        return true;
    }

    function showSuccess(res) {

        layer.ready(function () {
            layer.close(index);
            if (1 == res.code) {
                layer.alert(res.msg, {title: '友情提示', icon: 1, closeBtn: 0}, function () {
                    window.location.href = res.data;
                });
            } else if (111 == res.code) {
                window.location.reload();
            } else {
                layer.msg(res.msg, {anim: 6});
            }
        });
    }


    $(document).ready(function () {

        // 添加角色
        var options = {
            beforeSubmit: showStart,
            success: showSuccess
        };

        $('#site_info').submit(function () {
            $(this).ajaxSubmit(options);
            return false;
        });

        $('#seo_set').submit(function () {
            $(this).ajaxSubmit(options);
            return false;
        });

        $('#app_version').submit(function () {
            $(this).ajaxSubmit(options);
            return false;
        });

        $('#store').submit(function () {
            $(this).ajaxSubmit(options);
            return false;
        });

        $('#pay_num').submit(function () {
            $(this).ajaxSubmit(options);
            return false;
        });

        $('#pay_error_num').submit(function () {
            $(this).ajaxSubmit(options);
            return false;
        });

        $('#transaction').submit(function () {
            $(this).ajaxSubmit(options);
            return false;
        });

    });


    // 上传图片
    layui.use('upload', function () {
        var upload = layui.upload;

        //执行实例
        var uploadInst = upload.render({
            elem: '#avatar1' //绑定元素
            , url: "{:url('articles/uploadImg')}" //上传接口
            , done: function (res) {
                //上传完毕回调
                $("#avatar").val(res.data.src);
                $("#sm").html('<img src="' + res.data.src + '" style="width:40px;height: 40px;"/>');
            }
            , error: function () {
                //请求异常回调
            }
        });
    });


</script>
</body>
</html>
